package top.fangw.oauth.handler;

import org.springframework.context.annotation.Primary;
import org.springframework.security.oauth2.server.authorization.OAuth2Authorization;
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
import org.springframework.security.oauth2.server.authorization.OAuth2TokenType;
import org.springframework.security.oauth2.server.authorization.client.RegisteredClient;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author: fgw
 * @createDate: 2024/2/22
 */
public class MyOAuth2AuthorizationServiceImpl implements OAuth2AuthorizationService {
    @Override
    public void save(OAuth2Authorization authorization) {
        System.out.println("authorization = " + authorization);
    }

    @Override
    public void remove(OAuth2Authorization authorization) {
        System.out.println("authorization = " + authorization);
    }

    @Override
    public OAuth2Authorization findById(String id) {

        OAuth2Authorization build = OAuth2Authorization.withRegisteredClient(RegisteredClient.withId("").build()).build();
        return build;
    }

    @Override
    public OAuth2Authorization findByToken(String token, OAuth2TokenType tokenType) {
        return null;
    }
}
